import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-05
 * Time: 17:31
 */
public class test31 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        int sum=0;
        for (int i = 0; i < n; i++) {
            array[i]=sc.nextInt();
        }

        for (int i = 0; i < n; i++) {
            int a=0;
            int b=1;
            for (int j = i; j < n; j++) {
                a+=array[j];
                b*=array[j];

            }
            if(a>b){
                sum++;
            }
        }

        System.out.println(sum);
    }
}
